package com.student_exam_system.service.impl;

import com.student_exam_system.dao.UserPaperMapper;
import com.student_exam_system.pojo.UserPaper;
import com.student_exam_system.service.UserPaperService;

import org.springframework.stereotype.Service;

/**
 * @author fire'ge
 */
@Service("userPaperServiceImpl")
public class UserPaperServiceImpl implements UserPaperService {
    final
    UserPaperMapper userPaperMapper;

    public UserPaperServiceImpl(UserPaperMapper userPaperMapper) {
        this.userPaperMapper = userPaperMapper;
    }


    @Override
    public int addUserPaper(UserPaper userPaper) {
        return userPaperMapper.addUserPaper(userPaper);
    }

    @Override
    public int updateUserPaper(int userId) {
        UserPaper userPaper = userPaperMapper.queryUserPaperById(userId);
        return userPaperMapper.updateUserPaper(userPaper);
    }

    @Override
    public int updateUserPaperByPaperAndUser(int upUser, int classId) {
        return userPaperMapper.updateUserPaperByPaperAndUser(upUser,classId);
    }
}
